<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="/static/images/order/timg.jpg">
    <link rel="icon" href="/static/images/order/timg.jpg">
    <title>我的书架</title>
    {css href="/static/layout/css/style.css" }
    {css href="/static/layout/css/style-responsive.css" }
    <script src="./static/js/jquery-1.8.3.min.js"></script>
    {css href="/static/css/toastr.min.css"}
    <link rel="stylesheet" href="/static/css/order.css">
    <link rel="stylesheet" href="/static/css/index.css">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
	<style>
	     .customerbox{margin:0 auto;width:1200px;height:830px;background-color: #FDFDFB;margin-top:20px;}
	     #orderinfo{width:987px;height:103px;border-bottom: 1px dotted #E5E5E5;float:left;margin-left:20px;}
	     #orderinfo1{width:987px;height:103px;border-bottom: 1px dotted #E5E5E5;float:left;margin-left:20px;}
	     #orderinfo1 li{border-right: 1px solid #E5E5E5;height:103px;list-style:none;float:left;text-align:center;line-height:103px;}
	     #orderinfo li{border-right: 1px solid #E5E5E5;height:103px;list-style:none;float:left;text-align:center;line-height:103px;}
	     #orderinfo2{width:987px;height:103px;border-bottom: 1px dotted #E5E5E5;float:left;margin-left:20px;}
	     #orderinfo2 li{border-right: 1px solid #E5E5E5;height:103px;list-style:none;float:left;text-align:center;line-height:103px;}
	     .delorder{display:inline-block;color:red;background-color:#FDFDFB;font-size:12px;width:70px;height:30px;border:none;text-align:center;line-height:30px;outline:none;}
	     h1{width: 998px;height:40px;border-bottom: 1px solid #e6e5e3;float: left;margin-left: 15px;font-size:22px;line-height:30px;display:inline-block;}
	     .vipleader{font-size:18px;width: 998px;height:40px;text-align:center;color:red;float:left;}
	     .vip{width: 998px;height:200px;border: 1px solid #f5f5f5;background: #FAFAFA;float:left;margin-left:20px;}
	     .vipimg{width:200px;height:200px;float:right;margin-top:-53px;margin-right:157px;opacity:0.5}
	     .vippay{border:none;background-color:#ee524c;text-align:center;line-height:54px;color:white;border-radius:5px;width:120px;height:54px;display:inline-block;margin-left:122px;margin-top:75px;font-size:16px;}
	</style>
</head>
<body class="horizontal-menu-page" style="background: #fff;">
	<nav class="navbar navbar-default" role="navigation">
	    <div class="container-fluid">
	        <!-- Brand and toggle get grouped for better mobile display -->
	        <div class="navbar-header">
	            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
	                <span class="sr-only">Toggle navigation</span>
	                <span class="icon-bar"></span>
	                <span class="icon-bar"></span>
	                <span class="icon-bar"></span>
	            </button>
	            <a class="navbar-brand" href="{:url('index/Index/index')}">
                    <img src="/static/index/images/logo.png" height="42px">
                </a>
	        </div>


	        <!-- Collect the nav links, forms, and other content for toggling -->
	        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	            <ul class="nav navbar-nav">
                    <li><a href="{:url('index/Index/index')}">首页</a></li>
                    <li><a href="{:url('index/Category/index')}?where=0">分类 </a></li>
                    <li><a href="{:url('index/Category/rank',['id'=>0])}">榜单 </a></li>
                    <li><a href="{:url('index/Register/registerauthor')}">成为作者</a></li>
                    <li><a href="{:url('index/Author/index')}">作者专区</a></li>
                </ul>

	              <ul class="nav navbar-nav navbar-right" style="margin-right:100px;">
                    <li>
                        <form class="navbar-form navbar-left" role="search" action="{:url('index/Index/find')}" method="post">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Search" name="search">&nbsp;
                                <button class="btn btn-info ">搜索</button>
                            </div>
                        </form>
                    </li>

                    {if ( empty($Think.session.user) && empty($Think.cookie.loginid) )}
                    <li class="dropdown">
                        <a href="{:url('index/Register/index')}">注册</a> <b lass="caret"></b>
                    </li>
                    <li><a type="button" data-toggle="modal" data-target=".bs-example-modal-sm">登陆</a>

                        <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog"
                             aria-labelledby="mySmallModalLabel">
                            <div class="modal-dialog modal-sm" role="document">
                                <div class="modal-content" style="margin-top: 250px;">
                                    <form action="{:url('index/Login/login')}" method="post">
                                        <!-- <img src="" alt=""> -->
                                        <input type="text" class="form-control" name="tel" autocomplete="off" maxlength="11" placeholder="账号">
                                        <input type="password" class="form-control" name="pass" autocomplete="off" placeholder="密码">
                                        <div class="form-group">
                                            <div class="col-sm-10">
                                                <div class="checkbox">
                                                    <label>
                                                        <input type="checkbox" name="checkbox">记住密码
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <button type="submit" class="btn btn-default btn-lg btn-block">登陆</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </li>
                    {else/}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                          {if empty($Think.session.user.icon) && empty($Think.cookie.loginicon)}
                             <img src="/static/images/details/10.jpg">
                          {else/} 
                          <img src="{$Think.session.user? $Think.session.user.icon : $Think.cookie.loginicon}">
                          {/if}
                            {$Think.session.user? $Think.session.user.name : $Think.cookie.loginname} 
                            <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="{:url('index/BookShelf/index')}">我的书架
                            <li><a href="{:url('index/Personal/index',['id'=>$Think.session.user? $Think.session.user.id : $Think.cookie.loginid])}">我的账号</a></li>
                            <li><a href="{:url('index/Login/logout')}">注销</a></li>
                        </ul>
                    </li>
                    {/if}
                    <li><a href="{:url('index/BuyCar/read',['id'=>$Think.session.user? $Think.session.user.id : $Think.cookie.loginid])}">购物车 ({$buycount})</a></li>
                </ul>
	        </div><!-- /.navbar-collapse -->
	    </div><!-- /.container-fluid -->
	</nav>
	<div class="customerbox">
		<!-- 右边导航栏 -->
		<div class="customerright">
			<div class="customerinfo">
				<div class="customericon">
					{if empty($Think.session.user.icon) && empty($Think.cookie.loginicon)}
                       <img src="/static/images/details/10.jpg">
                    {else/} 
				   <img src="{$Request.session.user.icon}">
				   {/if}
				</div>
				<div class="customername">
				   <a href="">{$Request.session.user.name}</a>
			    </div>
			</div>
			<ul class="rightlist">
				<li style="background-color:#34495E;color:white;">我的图书</li>
				<div style="display:none;">
					<div class="contentleader">
						<img src="/static/index/images/logo.png" height="42px" style="float:right;">
						<li class="leaderbtn" style="font-weight:bold;">全部({$allcount})</li>
						<div class="bookcontainer">
							{if empty($info)}
							<div class="bookimages"></div>
							<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
							{else/}
							{foreach $info as $vo}
							<div class="bookimg">
								<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
								<a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
								<span class="status">{$vo.see}</span>
							</div>
							{/foreach}
							{/if}
						</div>
						<li class="leaderbtn">已购买({$count})</li>
						<div class="bookcontainer">
							{if empty($list)}
							<div class="bookimages"></div>
							<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
							{else/}
							{foreach $list as $vo}
							<div class="bookimg">
								<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
								<a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
								<span class="status">已购买</span>
							</div>
							{/foreach}
							{/if}
						</div>
						<li class="leaderbtn">已收藏({$collectcount})</li>
						<div class="bookcontainer">
							{if empty($data)}
							<div class="bookimages"></div>
							<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
							{else/}
							{foreach $data as $vo}
							<div class="bookimg">
							     <img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
							     <a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
							     <span class="status">已收藏</span>
							     <button class="delete" data-id="{$vo.id}">x</button>
						    </div>
						    {/foreach}
						    {/if}
						</div>
						<!-- <li class="leaderbtn">会员免费(0)</li>
						<div class="bookcontainer">4</div>
						<li class="leaderbtn">套餐包(0)</li>
						<div class="bookcontainer">5</div> -->
					</div>
					<div class="contentinfo">
						{if empty($info)}
						<div class="bookimages"></div>
						<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
						{else/}
						{foreach $info as $vo}
						<div class="bookimg">
							<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
							<a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
							<span class="status">已购买</span>
						</div>
						{/foreach}
						{/if}
					</div>
				</div>
				<li>我的订单</li>
				<div style="display:none;">
					<div class="myorder">
						<span>订单类型/订单号</span>
						<span>订单商品</span>
						<span>订单金额</span>
						<span>购买/下单时间</span>
						<span>
							<select name="status">
								<option value="0" selected>全部状态</option>
								<option value="1">待支付</option>
								<option value="2">已支付</option>
							</select>
						</span>
					</div>
					<div class="box1" style="display:none">
					{if empty($nomoney)}
					<div class="bookimages"></div>
					<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
					{else/}
					{foreach $nomoney as $vo}
					<ul id="orderinfo1">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')} <button class="delorder" data-id="{$vo.id}">删除订单</button></li>
					 </ul>
					{/foreach}
					{/if}
                    </div>

                    <div class="box2" style="display:none">
                    {if empty($list)}
                    <div class="bookimages"></div>
					<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
                    {else/}
					{foreach $list as $vo}
					<ul id="orderinfo2">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')}</li>
					</ul>
					{/foreach}
					{/if}
					</div>
                     
                    <div class="box" style="display:none">
                    {if empty($order)}
                    <div class="bookimages"></div>
					<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
                    {else/}
					{foreach $list as $vo}
					<ul id="orderinfo">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')}</li>
					</ul>
					{/foreach}
					{foreach $nomoney as $vo}
					<ul id="orderinfo">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')} <button class="delorder" data-id="{$vo.id}">删除订单</button></li>
					</ul>
					{/foreach}
					{/if}
					</div>

					<div class="boxinfo">
					{if empty($order)}
					<div class="bookimages"></div>
					<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
					{else/}
					{foreach $list as $vo}
					<ul id="orderinfo">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')}</li>
					</ul>
					{/foreach}
					{foreach $nomoney as $vo}
					<ul id="orderinfo">
						<li style="width:184px;">{$vo.order_number}</li>
						<li style="width:258px;">{$vo.name}</li>
						<li style="width:153px;">{$vo.pay_money}元</li>
						<li style="width:181px;">{$vo.otime}</li>
						<li style="width:206px;">{$vo.status==0?'待支付':($vo.status==1?'已支付':'已取消')} <button class="delorder" data-id="{$vo.id}">删除订单</button></li>
					</ul>
					{/foreach}
					{/if}
					</div>
				</div>
				<!--我的作品-->
				<!--<li class="leaderbtn" style="margin-left:0px;">我的作品</li>-->
				<!--<div class="bookcontainer">-->
					<!--{foreach $mybook as $vo}-->
					<!--<div class="bookimg">-->
						<!--<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">-->
						<!--<a href="{:url('index/Article/index',['name'=>$vo['name']])}">{$vo.name}</a>-->
						<!--<span class="status">我的作品</span>-->
						<!--<button class="delete" data-id="{$vo.id}">x</button>-->
					<!--</div>-->
					<!--{/foreach}-->
				<!--</div>-->
				<!--我的作品-->

				<li class="leaderbtn" style="margin-left:0px;">账户充值</li>
				<div style="display:none;">
				   <h1>新芽会员充值<img src="/static/index/images/logo.png" height="42px" style="float:right;"></h1>
				   <div class="vipleader">会员特权</div>
				   <div class="vip">
				   	<img src="/static/index/images/logo.png" height="42px" style="margin-top:15px;margin-left:15px;">
				   	<span style="position:relative;top:5px;font-size:14px;color:#999;left:10px;">新芽阅读黄金会员</span>
				   	<span style="position:relative;top:45px;font-size:14px;color:#999;left:-205px;">体验新鲜，畅享时尚，预知的精彩，未知的惊喜！新芽会员都给您</span>
				   	<span style="font-size:22px;display:inline-block;margin-top:47px;margin-left:20px;color:red;">开通会员购买图书即可享受0.7折的优惠！</span>
				   	<div class="vipimg"><img src="/static/images/details/index.jpg" height="190px"></div>
				   </div>
                   <p style="float:left;font-size:18px;margin-left:20px;margin-top:20px;">开通服务:<span style="font-size:18px;color:red;diplay:inline-block;margin-left:10px;">新芽会员</span></p>
                   <p style="float:left;font-size:18px;margin-left:-160px;margin-top:60px;">开通账号:<span style="font-size:18px;color:red;diplay:inline-block;margin-left:10px;">{$usertel.tel}</span></p>
                   <p style="float:left;font-size:18px;margin-left:-200px;margin-top:100px;">应付金额:<span style="font-size:18px;color:red;diplay:inline-block;margin-left:10px;">15元/月</span></p>
                   <button class="vippay" data-id="{$usertel.id}">立即开通</button>
				</div>
			</ul>
		</div>
		<!-- 内容导航栏 -->
		<div class="infobox">
		<div class="contentleader">
			<li class="leaderbtn" style="font-weight:bold;">全部({$allcount})</li>
			<div class="bookcontainer">
				{if empty($info)}
				<div class="bookimages"></div>
				<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
				{else/}
				{foreach $info as $vo}
				<div class="bookimg">
				    <img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
				    <a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
				    <span class="status">{$vo.see}</span>
				</div>
				{/foreach}
				{/if}

			</div>
			<li class="leaderbtn">已购买({$count})</li>
			<div class="bookcontainer">
				           {if empty($list)}
							<div class="bookimages"></div>
							<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
							{else/}
							{foreach $list as $vo}
							<div class="bookimg">
								<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
								<a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
								<span class="status">已购买</span>
							</div>
							{/foreach}
							{/if}
			</div>
			<li class="leaderbtn">已收藏({$collectcount})</li>
			<div class="bookcontainer">
				{if empty($data)}
				<div class="bookimages"></div>
				<a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
				{else/}
				{foreach $data as $vo}
					<div class="bookimg">
					    <img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
					    <a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
					    <span class="status">已收藏</span>
					    <button class="delete" data-id="{$vo.id}">x</button>
					</div>
			    {/foreach}
			    {/if}
			</div>
			<!-- <li class="leaderbtn">会员免费(0)</li>
			<div class="bookcontainer">4</div>
			<li class="leaderbtn">套餐包(0)</li>
			<div class="bookcontainer">5</div> -->
			<img src="/static/index/images/logo.png" height="42px" style="float:right;">
		</div>
		<div class="contentinfo">
			{if empty($info)}
			<div class="bookimages"></div>
		    <a href="{:url('index/index/index')}" id="null">还没有图书，快去挑选吧</a>
			{else}
			{foreach $info as $vo}
			<div class="bookimg">
				<img src="{$vo.face}" title="{$vo.name}" style="width:150px;height:200px">
				<a href="{:url('index/Details/read',['id'=>$vo.did])}">{$vo.name}</a>
				<span class="status">{$vo.see}</span>
			</div>
			{/foreach}
			{/if}
		</div>
		</div>
	</div>
	<footer style="border:0;font-size: 16px;">
        <div class="row">
            <div class="ft-box center">
                <div class="col-md-3">
                    <div class="ft-icon ft-icon1"></div>
                    <p class="mgt10">正版电子书</p>
                </div>
                <div class="col-md-3">
                    <div class="ft-icon ft-icon2"></div>
                    <p class="mgt10">多平台畅读</p>
                </div>
                <div class="col-md-3">
                    <div class="ft-icon ft-icon3"></div>
                    <p class="mgt10">海量图书资源</p>
                </div>
                <div class="col-md-3">
                    <div class="ft-icon ft-icon4"></div>
                    <p class="mgt10">优质阅读体验</p>
                </div>
                <div style="clear:both"></div>
            </div>
                

            <div class="ft-link">
                <dl class="col-md-4">
                    <dt>帮助</dt>
                    <dd><a href="">如何购买图书</a></dd>
                    <dd><a href="">常见问题</a></dd>
                    <dd><a href="">支付方式</a></dd>
                </dl>
                 <dl class="col-md-4">
                    <dt>平台入驻</dt>
                    <dd><a href="">机构专区</a></dd>
                    <dd><a href="">个人作者专区</a></dd>
                </dl>
                 <dl class="col-md-4">
                    <dt>投诉与建议</dt>
                    <dd><a href="">问题反馈</a></dd>
                </dl>
            </div>

        </div>
    </footer>

<!-- Placed js at the end of the document so the pages load faster -->
{js href="/static/layout/js/jquery-1.10.2.min.js" }
{js href="/static/layout/js/jquery-ui-1.9.2.custom.min.js" }
{js href="/static/layout/js/jquery-migrate-1.2.1.min.js" }
{js href="/static/layout/js/bootstrap.min.js" }
{js href="/static/layout/js/modernizr.min.js" }
{js href="/static/layout/js/jquery.nicescroll.js" }
{js href="/static/js/toastr.min.js"}

<!--common scripts for all pages-->
{js href="/static/layout/js/scripts.js"}
<script>
        $(function () {
            // 设置弹框参数
            toastr.options = {
                closeButton: true,// 是否显示关闭按钮
                progressBar: true,// 实现显示计时条
                timeOut: "3000",  // 自动关闭时间
                positionClass: "toast-top-right" // 提示位置
                // toast-top-full-width 顶端，宽度铺满整个屏幕
                // toast-top-right  顶端右边
            };
        });

        function DeleteCollect(collect_id,obj) {
            $.ajax({
                type: 'delete',
                url: '/bookshelf/'+collect_id,
                dataType:'json',
                success: function (data) {
                    if (data.status) {
                        toastr.success(data.info);
                        // 将该条目删除掉
                        obj.remove();
                    } else {
                        toastr.error(data.info, 'FBI WARING:');
                    }
                },
                error: function () {
                    alert('AJAX操作失败');
                }
            });
        }

        function DeleteOrder(oid,obj) {
        $.ajax({
            type: 'get',
            url: '/delorder/'+oid,
            dataType:'json',
            success: function (data) {
                if (data.status) {
                    toastr.success(data.info);
                    // 将该条目删除掉
                    obj.remove();
                } else {
                    toastr.error(data.info, 'FBI WARING:');
                }
            },
            error: function () {
                alert('AJAX操作失败');
            }
        });
    }
        
        $('.rightlist li').click(function(){
          $('.infobox').html($(this).next('div').html());
          $(this).css({backgroundColor:'#34495E',color:'white'}).prevAll('li').css({backgroundColor:'#F7F7F5',color:'#666'});
          $(this).css({backgroundColor:'#34495E',color:'white'}).nextAll('li').css({backgroundColor:'#F7F7F5',color:'#666'});
          $('.contentleader li').click(function(){
            $('.contentinfo').html($(this).next('div').html());
            $(this).css({fontWeight:'bold'}).prevAll('li').css({fontWeight:'normal'});
            $(this).css({fontWeight:'bold'}).nextAll('li').css({fontWeight:'normal'});
            // 触发删除收藏
            $('.delete').click(function () {
                var collect_id = $(this).attr('data-id');
                if (confirm('你确定要[删除]吗?!')) {
                    var obj = $(this).parent('div');
                    DeleteCollect(collect_id,obj); // 指定添加信息操作
                }
                
            });
           });
          // 触发删除收藏
            $('.delete').click(function () {
                var collect_id = $(this).attr('data-id');
                if (confirm('你确定要[删除]吗?!')) {
                    var obj = $(this).parent('div');
                    DeleteCollect(collect_id,obj); // 指定添加信息操作
                }
                
            });

            //删除未支付订单
               	$('.delorder').click(function () {
                   var oid = $(this).attr('data-id');
                   if (confirm('你确定要[删除]吗?!')) {
                   var obj = $(this).parents('#orderinfo');
                   DeleteOrder(oid,obj); // 指定删除信息操作
                }
            
                });//删除未支付订单

            $('select[name=status]').change(function(){
               var selectedValue=$(this).val();
               if(selectedValue==0){
               	$('.boxinfo').html($('.box').html());
               	//删除未支付订单
               	$('.delorder').click(function () {
                   var oid = $(this).attr('data-id');
                   if (confirm('你确定要[删除]吗?!')) {
                   var obj = $(this).parents('#orderinfo');
                   DeleteOrder(oid,obj); // 指定删除信息操作
                }
            
                });//删除未支付订单
                 }
               if(selectedValue==1){
               	$('.boxinfo').html($('.box1').html());
               	//删除未支付订单
               	$('.delorder').click(function () {
                   var oid = $(this).attr('data-id');
                   if (confirm('你确定要[删除]吗?!')) {
                   var obj = $(this).parents('#orderinfo');
                   DeleteOrder(oid,obj); // 指定删除信息操作
                }
            
                });//删除未支付订单
                 }
               if(selectedValue==2){
               	$('.boxinfo').html($('.box2').html());
                 }
            });
            
            $('.vippay').click(function(){
            	 if(confirm('你即将开通新芽会员')){
                    var id = $(this).attr('data-id');
                    vip(id);
            	 }
            });
           
         });

        $('.contentleader li').click(function(){
          $('.contentinfo').html($(this).next('div').html());
          $(this).css({fontWeight:'bold'}).prevAll('li').css({fontWeight:'normal'});
          $(this).css({fontWeight:'bold'}).nextAll('li').css({fontWeight:'normal'});
          // 触发删除收藏
            $('.delete').click(function () {
                var collect_id = $(this).attr('data-id');
                console.log(collect_id);
                if (confirm('你确定要[删除]吗?!')) {
                    var obj = $(this).parent('div');
                    DeleteCollect(collect_id,obj); // 指定添加信息操作
                }
                
            });
         });


        function vip(id) {
        $.ajax({
        	data:{'uid':id},
            type: 'post',
            url: '/vipbegin/',
            dataType:'json',
            success: function (data) {
                if (data.status) {
                    toastr.success(data.info);
                } else {
                    toastr.error(data.info, 'FBI WARING:');
                }
            },
            error: function () {
                alert('AJAX操作失败');
            }
        });
    }
</script>
</body>
</html>